#@layout()

#define css()
<style>
	.jp-image-browser{
        margin-top:0.5rem;
        margin-bottom:0.5rem;
    }
    .form-group .thumb-img{
        width: 200px;
    }
    .setting-tips{
        color:#999;
        font-size:1.4rem;
        margin-top:0.5rem;
    }
    .form-group .download-img{
        height: 200px;
    }
    .form-group .download-btn{
        height: 40px;
    }

</style>

#end

#define content()
<div class="content-wrapper">

	<section class="content-header">
		<h1>
			模板设置
			<small>Template Setting</small>
		</h1>
	</section>

	<section class="content">

		<div class="row">
			<div class="col-xs-12">
				<div class="box box-primary">
					<div class="box-header ">
						<h3 class="box-title"></h3>
					</div>

					<form class="form-horizontal form-setting" autocomplete="off" id="optionForm">
						<div class="box-body ">

							<!-- Custom Tabs -->
							<div class="nav-tabs-custom">
								<ul class="nav nav-tabs">
									<li class="active"><a href="#tab_pubset" data-toggle="tab">公共设置</a></li>
									#for(setPage : pageList)
									<li><a href="##(setPage.pageCode)" data-toggle="tab">#(setPage.pageName)</a></li>
									#end
									<!-- <li><a href="#tab_otherset" data-toggle="tab">其他设置</a></li> -->
								</ul>
								<div class="tab-content">
									<div class="tab-pane active" id="tab_pubset">
										<div class="setting-panl">

											<h4 class="page-header">企业信息</h4>
											<div class="form-group">
												<label class="col-sm-2 control-label">企业名称(中文)</label>
											
												<div class="col-sm-6">
													<input type="input" class="form-control" placeholder="将在网站的所有体现企业中文名称的位置出现" name="autopage_corp_name" value="#option('autopage_corp_name')">
												</div>
											</div>
											<div class="form-group">
												<label class="col-sm-2 control-label">企业名称(英文)</label>
											
												<div class="col-sm-6">
													<input type="input" class="form-control" placeholder="将在网站的所有体现企业英文名称的位置出现" name="autopage_corp_nameen" value="#option('autopage_corp_nameen')">
												</div>
											</div>
											<div class="form-group">
												<label class="col-sm-2 control-label">服务热线</label>
											
												<div class="col-sm-6">
													<input type="input" class="form-control" placeholder="将在网站的所有体现服务热线的位置出现" name="autopage_corp_servtel" value="#option('autopage_corp_servtel')">
												</div>
											</div>
											<div class="form-group">
												<label class="col-sm-2 control-label">联系地址</label>
											
												<div class="col-sm-6">
													<input type="input" class="form-control" placeholder="将在网站的所有体现联系地址的位置出现" name="autopage_corp_address" value="#option('autopage_corp_address')">
												</div>
											</div>
											<div class="form-group">
												<label class="col-sm-2 control-label">联系邮箱</label>
											
												<div class="col-sm-6">
													<input type="input" class="form-control" placeholder="将在网站的所有体现联系邮箱的位置出现" name="autopage_corp_mail" value="#option('autopage_corp_mail')">
												</div>
											</div>
											<div class="form-group">
												<label class="col-sm-2 control-label">联系手机</label>
											
												<div class="col-sm-6">
													<input type="input" class="form-control" placeholder="将在网站的所有体现联系手机的位置出现" name="autopage_corp_phone" value="#option('autopage_corp_phone')">
												</div>
											</div>
											<div class="form-group">
												<label class="col-sm-2 control-label">网站顶部icon</label>
												<div class="col-sm-6">
													<button type="button" for-src="autopage_icon_logo_img" for-input="autopage_icon_logo" class="btn-image-browser btn btn-flat btn-default btn-xs">
														<i class="fa fa-fw fa-image"></i> 选择图片
													</button>
													<br />
													<img class="thumb-img" src="#(CPATH)#option('autopage_icon_logo','/static/commons/img/nothumbnail.jpg')" id="autopage_icon_logo_img" />
													<input type="hidden" id="autopage_icon_logo" name="autopage_icon_logo" value="#option('autopage_icon_logo')">
													<p class="setting-tips">图片大小建议：45px X 45px</p>
												</div>
											</div>
											<div class="form-group">
												<label class="col-sm-2 control-label">企业Logo-PC端</label>
												<div class="col-sm-6">
													<button type="button" for-src="autopage_corp_logo_pc_img" for-input="autopage_corp_logo_pc" class="btn-image-browser btn btn-flat btn-default btn-xs">
														<i class="fa fa-fw fa-image"></i> 选择图片
													</button>
													<br />
													<img class="thumb-img" src="#(CPATH)#option('autopage_corp_logo_pc','/static/commons/img/nothumbnail.jpg')" id="autopage_corp_logo_pc_img" />
													<input type="hidden" id="autopage_corp_logo_pc" name="autopage_corp_logo_pc" value="#option('autopage_corp_logo_pc')">
													<p class="setting-tips">图片大小建议：45px X 45px</p>
												</div>
											</div>
											<div class="form-group">
												<label class="col-sm-2 control-label">企业Logo-移动端</label>
												<div class="col-sm-6">
													<button type="button" for-src="autopage_corp_logo_mb_img" for-input="autopage_corp_logo_mb" class="btn-image-browser btn btn-flat btn-default btn-xs">
														<i class="fa fa-fw fa-image"></i> 选择图片
													</button>
													<br />
													<img class="thumb-img" src="#(CPATH)#option('autopage_corp_logo_mb','/static/commons/img/nothumbnail.jpg')" id="autopage_corp_logo_mb_img" />
													<input type="hidden" id="autopage_corp_logo_mb" name="autopage_corp_logo_mb" value="#option('autopage_corp_logo_mb')">
													<p class="setting-tips">图片大小建议：50px X 50px</p>
													<p class="help-block"> 非必须，取决于移动端是否使用独立于PC端的logo </p>
													
												</div>
											</div>
											<div class="form-group">
												<label class="col-sm-2 control-label">微信二维码</label>
												<div class="col-sm-6">
													<button type="button" for-src="autopage_corp_wechat_qrcode_img" for-input="autopage_corp_wechat_qrcode" class="btn-image-browser btn btn-flat btn-default btn-xs">
														<i class="fa fa-fw fa-image"></i> 选择图片
													</button>
													<br />
													<img class="thumb-img" src="#(CPATH)#option('autopage_corp_wechat_qrcode','/static/commons/img/nothumbnail.jpg')" id="autopage_corp_wechat_qrcode_img" />
													<input type="hidden" id="autopage_corp_wechat_qrcode" name="autopage_corp_wechat_qrcode" value="#option('autopage_corp_logo_mb')">
													<p class="setting-tips">图片大小建议：50px X 50px</p>
													<p class="help-block"> 非必须，取决于模板中是否需要展示微信二维码 </p>
													
												</div>
											</div>


											<h4 class="page-header">网站信息</h4>
											<div class="form-group">
												<label class="col-sm-2 control-label">网站名称</label>

												<div class="col-sm-6">
													<input type="input" class="form-control" placeholder="给您的网站起个名字" name="web_name" value="#option('web_name')">
												</div>
											</div>
											<div class="form-group">
												<label class="col-sm-2 control-label">网站标题</label>

												<div class="col-sm-6">
													<input type="input" class="form-control" placeholder="设置网站的主标题" name="web_title" value="#option('web_title')">
												</div>
											</div>

											<div class="form-group">
												<label class="col-sm-2 control-label">网站副标题</label>

												<div class="col-sm-6">
													<input type="input" class="form-control" placeholder="副标题..." name="web_subtitle" value="#option('web_subtitle')">
												</div>
											</div>

											<div class="form-group">
												<label class="col-sm-2 control-label">备案号</label>

												<div class="col-sm-6">
													<input type="input" class="form-control" placeholder="网站在中国区接入需要备案号" name="web_ipc_no" value="#option('web_ipc_no')">
												</div>
											</div>

											<div class="form-group">
												<label class="col-sm-2 control-label">版权信息</label>

												<div class="col-sm-6">
													<textarea rows="5" class="form-control" name="web_copyright" placeholder="版权信息一般显示在网站的底部...">#option("web_copyright")</textarea>
												</div>
											</div>



										</div>
									</div>
									#for(setPage : pageList)
									<div class="tab-pane" id="#(setPage.pageCode)">
										<!-- 遍历页面的所有组件 -->
										#for(pageCmt : setPage.pageCmtList)
										<div class="setting-panl">
											<!-- 显示组件名称 -->
											<h4 class="page-header">#(pageCmt.componentName)</h4>
											<!-- 遍历组件的所有配置项option -->
											#for(setOption : pageCmt.optionSettings)
											#if(setOption.code.contains(PageConst.TEXT_AREA_KEY))
											<div class="form-group">
												<label class="col-sm-2 control-label">#(setOption.name)</label>
												<div class="col-sm-6">
													<textarea rows="3" class="form-control" placeholder="#(setOption.placestr)" name="#(setOption.optionKey)">#option(setOption.optionKey)</textarea>
												</div>
											</div>
											#else if(setOption.code.contains(PageConst.TEXT_KEY))
											<div class="form-group">
												<label class="col-sm-2 control-label">#(setOption.name)</label>
												<div class="col-sm-6">
													<textarea rows="1" class="form-control" placeholder="#(setOption.placestr)" name="#(setOption.optionKey)">#option(setOption.optionKey)</textarea>
												</div>
											</div>
											#else if(setOption.code.contains(PageConst.IMG_KEY))
											<div class="form-group">
												<label class="col-sm-2 control-label">#(setOption.name)</label>
												<div class="col-sm-6">
													<button type="button" for-src="#(setOption.optionKey + '_img')" for-input="#(setOption.optionKey)" class="btn-image-browser btn btn-flat btn-default btn-xs">
														<i class="fa fa-fw fa-image"></i> 选择图片
													</button>
													<br />
													<img class="thumb-img" src="#(CPATH)#option(setOption.optionKey,'/static/commons/img/nothumbnail.jpg')" id="#(setOption.optionKey + '_img')" />
													<input type="hidden" id="#(setOption.optionKey)" name="#(setOption.optionKey)" value="#option(setOption.optionKey)">
													<p class="setting-tips">图片大小建议：#(setOption.placestr)</p>
												</div>
											</div>
											
										#else if(setOption.code.contains(PageConst.ARTICLE_CATEGORY_KEY))
											<div class="form-group">
													<label class="col-sm-2 control-label">#(setOption.name)</label>
													<div class="col-sm-6">
													 <select class="form-control" name="#(setOption.optionKey)">
	                                            <option value="">全部分类</option>
	                                            #for(category : categories)
	                                            <option value="#(category.id ??)" #selectedIf(category.id.toString() == option(setOption.optionKey))>
	                                                #(category.layerString)#(category.title ??)
	                                            </option>
	                                            #end
	                                        </select>
											<p class="setting-tips">文章建议：#(setOption.placestr)</p>
													</div>
												</div>	
										#else if(setOption.code.contains(PageConst.SELECT_CATEGORY_KEY))
											<div class="form-group">
													<label class="col-sm-2 control-label">#(setOption.name)</label>
													<div class="col-sm-6">
													 <select class="form-control" name="#(setOption.optionKey)">
	                                            <option value="">选择分类</option>
	                                            #for(category : categories)
	                                            <option value="#(category.id ??)" #selectedIf(category.id.toString() == option(setOption.optionKey))>
	                                                #(category.layerString)#(category.title ??)
	                                            </option>
	                                            #end
	                                        </select>
											<p class="setting-tips">温馨提示：#(setOption.placestr)</p>
													</div>
												</div>	
										#else if(setOption.code.contains(PageConst.SELECT_TAG_KEY))
											<div class="form-group">
													<label class="col-sm-2 control-label">#(setOption.name)</label>
													<div class="col-sm-6">
													 <select class="form-control" name="#(setOption.optionKey)">
	                                            <option value="">选择标签</option>
	                                            #for(tag : tags)
	                                            <option value="#(tag.slug ??)" #selectedIf(tag.slug == option(setOption.optionKey))>
	                                                #(tag.layerString)#(tag.slug ??)
	                                            </option>
	                                            #end
	                                        </select>
											<p class="setting-tips">温馨提示：#(setOption.placestr)</p>
													</div>
												</div>	
										#else if(setOption.code.contains(PageConst.SELECT_BOOL_KEY))
	                                        <div class="form-group">
		                                        <label class="col-sm-2 control-label">#(setOption.name)</label>
		                                        <div class="col-sm-6">
		                                        	<input type="checkbox" class="switchery" data-for="#(setOption.optionKey)" #checkedIf(option(setOption.optionKey))>
		                                        	<input type="hidden" id="#(setOption.optionKey)" name="#(setOption.optionKey)">
		                                        	<p class="help-block"> #(setOption.placestr)</p>
		                                        </div>
	                                        </div>
										#else if(setOption.code.contains(PageConst.SELECT_ARTICLE_KEY))
											<div class="form-group">
													<label class="col-sm-2 control-label">#(setOption.name)</label>
													<div class="col-sm-6">
													 <select class="form-control" name="#(setOption.optionKey)">
	                                            <option value="">选择文章</option>
	                                            #for(article : articles)
	                                            <option value="#(article.id ??)" #selectedIf(article.id.toString() == option(setOption.optionKey))>
	                                                #(article.title ??)
	                                            </option>
	                                            #end
	                                        </select>
											<p class="setting-tips">温馨提示：#(setOption.placestr)</p>
													</div>
												</div>	
										#end
										#end
										</div>
										#end
									</div>
									#end


									<!-- 其他设置 开始-->
									<!-- 其他设置 结束-->
									
								</div>
							</div>
							<!-- /.tab-content -->





						</div>
						<div class="box-footer">
							<div class="col-sm-offset-2 col-sm-10 submit-block">
								<div class="box-submit">
									<button type="submit" class="btn btn-primary">提交</button>
								</div>
							</div>
						</div>
					</form>
				</div>
			</div>
		</div>

	</section>

</div>
#end
